package com.sntk.registermanager.staff.infrastructure.db.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.persistence.*;
import java.util.Date;

@Table(name = "register_manager_doctor_info", uniqueConstraints = @UniqueConstraint(columnNames = {"doctor_code"}))
@org.hibernate.annotations.Table(appliesTo = "register_manager_doctor_info", comment = "医生信息")
@Entity
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class DoctorInfoEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    //医生编号
    @Column(name = "doctor_code", length = 10, columnDefinition="varchar(10) COMMENT '医生编号'", nullable = false)
    private String doctorCode;

    //医生姓名
    @Column(name = "doctor_name", length = 10, columnDefinition="varchar(10) COMMENT '医生姓名'", nullable = false)
    private String doctorName;

    @Column(name = "gender", length = 1, columnDefinition="integer COMMENT '性别'", nullable = false)
    private Integer gender;

    @Column(name = "job_title", length = 10, columnDefinition="varchar(10) COMMENT '职称'")
    private String jobTitle;

    //登录账户名
    @Column(name = "uname", length = 10, columnDefinition="varchar(10) COMMENT '登录账户名'", nullable = false)
    private String uname;

    //联系电话
    @Column(name = "phone", length = 15, columnDefinition="varchar(15) COMMENT '联系电话'", nullable = false)
    private String phone;

    //医生简介
    @Column(name = "introduction", length = 100, columnDefinition="varchar(100) COMMENT '医生简介'")
    private String introduction;

    //备注
    @Column(name = "remark", length = 100, columnDefinition="varchar(10) COMMENT '备注'")
    private String remark;

    @Column(name = "img_src", length = 50, columnDefinition="varchar(50) COMMENT '照片路径'")
    private String imgSrc;

    //禁用状态
    @Column(name = "disabled", columnDefinition="bit(1) COMMENT '禁用状态'", nullable = false)
    private Boolean disabled;

    @Column(name = "del", columnDefinition="bit(1) COMMENT '删除标志'", nullable = false)
    private Boolean del;

    @Column(name = "create_time")
    private Date createTime;

    @Column(name = "creator", length = 50)
    private String creator;

    @Column(name = "last_update_time")
    private Date lastUpdateTime;

    @Column(name = "last_updator", length = 50)
    private String lastUpdator;

    @Version
    private Long version;
}
